.class public Lcom/hyphenate/chat/EMClient;
.super Ljava/lang/Object;


# static fields
.field private static final JOB_ID:I = 0xb

.field private static final JOB_INTERVAL:I = 0xea60

.field public static final TAG:Ljava/lang/String; = "EMClient"

.field public static final VERSION:Ljava/lang/String; = "3.2.2"

.field private static instance:Lcom/hyphenate/chat/EMClient;

.field static libraryLoaded:Z


# instance fields
.field private activitySize:I

.field private appStateListener:Lcom/hyphenate/chat/EMClient$AppStateListener;

.field private callManager:Lcom/hyphenate/chat/EMCallManager;

.field private chatConfig:Lcom/hyphenate/chat/EMChatConfig;

.field private chatManager:Lcom/hyphenate/chat/EMChatManager;

.field private chatroomManager:Lcom/hyphenate/chat/EMChatRoomManager;

.field private connectionListener:Lcom/hyphenate/chat/EMClient$MyConnectionListener;

.field private connectionListeners:Ljava/util/List;

.field private connectivityBroadcastReceiver:Landroid/content/BroadcastReceiver;

.field private contactManager:Lcom/hyphenate/chat/EMContactManager;

.field private cryptoUtils:Lcom/hyphenate/util/CryptoUtils;

.field private emaObject:Lcom/hyphenate/chat/adapter/EMAChatClient;

.field private encryptProvider:Lcom/hyphenate/chat/EncryptProvider;

.field private executor:Ljava/util/concurrent/ExecutorService;

.field private groupManager:Lcom/hyphenate/chat/EMGroupManager;

.field private mChatConfigPrivate:Lcom/hyphenate/chat/a/b;

.field private mContext:Landroid/content/Context;

.field private mainQueue:Ljava/util/concurrent/ExecutorService;

.field private sdkInited:Z

.field private smartHeartbeat:Lcom/hyphenate/chat/EMSmartHeartBeat;

.field stopService:Z

.field private wakeLock:Landroid/os/PowerManager$WakeLock;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    const/4 v0, 0x0

    sput-object v0, Lcom/hyphenate/chat/EMClient;->instance:Lcom/hyphenate/chat/EMClient;

    const/4 v0, 0x0

    sput-boolean v0, Lcom/hyphenate/chat/EMClient;->libraryLoaded:Z

    return-void
.end method

.method private constructor <init>()V
    .locals 3

    const/4 v2, 0x0

    const/4 v1, 0x0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    iput-object v1, p0, Lcom/hyphenate/chat/EMClient;->executor:Ljava/util/concurrent/ExecutorService;

    invoke-static {}, Ljava/util/concurrent/Executors;->newSingleThreadExecutor()Ljava/util/concurrent/ExecutorService;

    move-result-object v0

    iput-object v0, p0, Lcom/hyphenate/chat/EMClient;->mainQueue:Ljava/util/concurrent/ExecutorService;

    iput-object v1, p0, Lcom/hyphenate/chat/EMClient;->encryptProvider:Lcom/hyphenate/chat/EncryptProvider;

    new-instance v0, Lcom/hyphenate/util/CryptoUtils;

    invoke-direct {v0}, Lcom/hyphenate/util/CryptoUtils;-><init>()V

    iput-object v0, p0, Lcom/hyphenate/chat/EMClient;->cryptoUtils:Lcom/hyphenate/util/CryptoUtils;

    iput-boolean v2, p0, Lcom/hyphenate/chat/EMClient;->sdkInited:Z

    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    invoke-static {v0}, Ljava/util/Collections;->synchronizedList(Ljava/util/List;)Ljava/util/List;

    move-result-object v0

    iput-object v0, p0, Lcom/hyphenate/chat/EMClient;->connectionListeners:Ljava/util/List;

    new-instance v0, Lcom/hyphenate/chat/EMClient$MyConnectionListener;

    invoke-direct {v0, p0}, Lcom/hyphenate/chat/EMClient$MyConnectionListener;-><init>(Lcom/hyphenate/chat/EMClient;)V

    iput-object v0, p0, Lcom/hyphenate/chat/EMClient;->connectionListener:Lcom/hyphenate/chat/EMClient$MyConnectionListener;

    iput-object v1, p0, Lcom/hyphenate/chat/EMClient;->smartHeartbeat:Lcom/hyphenate/chat/EMSmartHeartBeat;

    new-instance v0, Lcom/hyphenate/chat/EMClient$9;

    invoke-direct {v0, p0}, Lcom/hyphenate/chat/EMClient$9;-><init>(Lcom/hyphenate/chat/EMClient;)V

    iput-object v0, p0, Lcom/hyphenate/chat/EMClient;->connectivityBroadcastReceiver:Landroid/content/BroadcastReceiver;

    iput v2, p0, Lcom/hyphenate/chat/EMClient;->activitySize:I

    return-void
.end method

.method static synthetic access$000(Lcom/hyphenate/chat/EMClient;)Lcom/hyphenate/chat/adapter/EMAChatClient;
    .locals 1

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatClient;

    return-object v0
.end method

.method static synthetic access$100(Lcom/hyphenate/chat/EMClient;)Ljava/util/List;
    .locals 1

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->connectionListeners:Ljava/util/List;

    return-object v0
.end method

.method static synthetic access$200(Lcom/hyphenate/chat/EMClient;)Landroid/content/Context;
    .locals 1

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->mContext:Landroid/content/Context;

    return-object v0
.end method

.method static synthetic access$300(Lcom/hyphenate/chat/EMClient;)Lcom/hyphenate/util/CryptoUtils;
    .locals 1

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->cryptoUtils:Lcom/hyphenate/util/CryptoUtils;

    return-object v0
.end method

.method static synthetic access$400(Lcom/hyphenate/chat/EMClient;)I
    .locals 1

    iget v0, p0, Lcom/hyphenate/chat/EMClient;->activitySize:I

    return v0
.end method

.method static synthetic access$408(Lcom/hyphenate/chat/EMClient;)I
    .locals 2

    iget v0, p0, Lcom/hyphenate/chat/EMClient;->activitySize:I

    add-int/lit8 v1, v0, 0x1

    iput v1, p0, Lcom/hyphenate/chat/EMClient;->activitySize:I

    return v0
.end method

.method static synthetic access$410(Lcom/hyphenate/chat/EMClient;)I
    .locals 2

    iget v0, p0, Lcom/hyphenate/chat/EMClient;->activitySize:I

    add-int/lit8 v1, v0, -0x1

    iput v1, p0, Lcom/hyphenate/chat/EMClient;->activitySize:I

    return v0
.end method

.method static synthetic access$500(Lcom/hyphenate/chat/EMClient;)Lcom/hyphenate/chat/EMClient$AppStateListener;
    .locals 1

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->appStateListener:Lcom/hyphenate/chat/EMClient$AppStateListener;

    return-object v0
.end method

.method public static getInstance()Lcom/hyphenate/chat/EMClient;
    .locals 1

    sget-object v0, Lcom/hyphenate/chat/EMClient;->instance:Lcom/hyphenate/chat/EMClient;

    if-nez v0, :cond_0

    invoke-static {}, Lcom/hyphenate/chat/EMClient;->loadLibrary()V

    new-instance v0, Lcom/hyphenate/chat/EMClient;

    invoke-direct {v0}, Lcom/hyphenate/chat/EMClient;-><init>()V

    sput-object v0, Lcom/hyphenate/chat/EMClient;->instance:Lcom/hyphenate/chat/EMClient;

    :cond_0
    sget-object v0, Lcom/hyphenate/chat/EMClient;->instance:Lcom/hyphenate/chat/EMClient;

    return-object v0
.end method

.method private handleError(Lcom/hyphenate/chat/adapter/EMAError;)V
    .locals 1

    invoke-virtual {p1}, Lcom/hyphenate/chat/adapter/EMAError;->errCode()I

    move-result v0

    if-eqz v0, :cond_0

    new-instance v0, Lcom/hyphenate/exceptions/HyphenateException;

    invoke-direct {v0, p1}, Lcom/hyphenate/exceptions/HyphenateException;-><init>(Lcom/hyphenate/chat/adapter/EMAError;)V

    throw v0

    :cond_0
    return-void
.end method

.method private initManagers()V
    .locals 2

    invoke-static {}, Lcom/hyphenate/cloud/EMHttpClient;->getInstance()Lcom/hyphenate/cloud/EMHttpClient;

    move-result-object v0

    iget-object v1, p0, Lcom/hyphenate/chat/EMClient;->mChatConfigPrivate:Lcom/hyphenate/chat/a/b;

    invoke-virtual {v0, v1}, Lcom/hyphenate/cloud/EMHttpClient;->onInit(Lcom/hyphenate/chat/a/b;)V

    invoke-virtual {p0}, Lcom/hyphenate/chat/EMClient;->chatManager()Lcom/hyphenate/chat/EMChatManager;

    invoke-virtual {p0}, Lcom/hyphenate/chat/EMClient;->contactManager()Lcom/hyphenate/chat/EMContactManager;

    invoke-virtual {p0}, Lcom/hyphenate/chat/EMClient;->groupManager()Lcom/hyphenate/chat/EMGroupManager;

    invoke-virtual {p0}, Lcom/hyphenate/chat/EMClient;->chatroomManager()Lcom/hyphenate/chat/EMChatRoomManager;

    invoke-virtual {p0}, Lcom/hyphenate/chat/EMClient;->setNatvieNetworkCallback()V

    return-void
.end method

.method private static loadLibrary()V
    .locals 1

    sget-boolean v0, Lcom/hyphenate/chat/EMClient;->libraryLoaded:Z

    if-nez v0, :cond_0

    const-string/jumbo v0, "hyphenate"

    invoke-static {v0}, Ljava/lang/System;->loadLibrary(Ljava/lang/String;)V

    const/4 v0, 0x1

    sput-boolean v0, Lcom/hyphenate/chat/EMClient;->libraryLoaded:Z

    :cond_0
    return-void
.end method

.method private registerActivityLifecycleCallbacks()V
    .locals 2
    .annotation build Landroid/annotation/TargetApi;
        value = 0xe
    .end annotation

    invoke-static {}, Lcom/hyphenate/util/Utils;->isSdk14()Z

    move-result v0

    if-eqz v0, :cond_0

    new-instance v1, Lcom/hyphenate/chat/EMClient$10;

    invoke-direct {v1, p0}, Lcom/hyphenate/chat/EMClient$10;-><init>(Lcom/hyphenate/chat/EMClient;)V

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->mContext:Landroid/content/Context;

    check-cast v0, Landroid/app/Application;

    check-cast v1, Landroid/app/Application$ActivityLifecycleCallbacks;

    invoke-virtual {v0, v1}, Landroid/app/Application;->registerActivityLifecycleCallbacks(Landroid/app/Application$ActivityLifecycleCallbacks;)V

    :cond_0
    return-void
.end method

.method private sendEmptyToken()V
    .locals 3

    const/4 v0, 0x0

    :goto_0
    const/4 v1, 0x3

    if-ge v0, v1, :cond_0

    invoke-static {}, Lcom/hyphenate/chat/EMPushHelper;->getInstance()Lcom/hyphenate/chat/EMPushHelper;

    move-result-object v1

    const-string/jumbo v2, ""

    invoke-virtual {v1, v2}, Lcom/hyphenate/chat/EMPushHelper;->sendTokenToServer(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_1

    :cond_0
    return-void

    :cond_1
    add-int/lit8 v0, v0, 0x1

    goto :goto_0
.end method


# virtual methods
.method _login(Ljava/lang/String;Ljava/lang/String;Lcom/hyphenate/EMCallBack;Z)V
    .locals 6

    invoke-virtual {p0}, Lcom/hyphenate/chat/EMClient;->getChatConfigPrivate()Lcom/hyphenate/chat/a/b;

    move-result-object v0

    if-nez v0, :cond_0

    const/4 v0, 0x1

    const-string/jumbo v1, ""

    invoke-interface {p3, v0, v1}, Lcom/hyphenate/EMCallBack;->onError(ILjava/lang/String;)V

    :goto_0
    return-void

    :cond_0
    const-string/jumbo v0, "EMClient"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v2, "emchat manager login in process:"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-static {}, Landroid/os/Process;->myPid()I

    move-result v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/hyphenate/util/EMLog;->e(Ljava/lang/String;Ljava/lang/String;)V

    new-instance v0, Lcom/hyphenate/chat/EMClient$6;

    move-object v1, p0

    move-object v2, p1

    move-object v3, p3

    move v4, p4

    move-object v5, p2

    invoke-direct/range {v0 .. v5}, Lcom/hyphenate/chat/EMClient$6;-><init>(Lcom/hyphenate/chat/EMClient;Ljava/lang/String;Lcom/hyphenate/EMCallBack;ZLjava/lang/String;)V

    invoke-virtual {p0, v0}, Lcom/hyphenate/chat/EMClient;->execute(Ljava/lang/Runnable;)V

    goto :goto_0
.end method

.method public addConnectionListener(Lcom/hyphenate/EMConnectionListener;)V
    .locals 2

    if-nez p1, :cond_0

    :goto_0
    return-void

    :cond_0
    iget-object v1, p0, Lcom/hyphenate/chat/EMClient;->connectionListeners:Ljava/util/List;

    monitor-enter v1

    :try_start_0
    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->connectionListeners:Ljava/util/List;

    invoke-interface {v0, p1}, Ljava/util/List;->contains(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_1

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->connectionListeners:Ljava/util/List;

    invoke-interface {v0, p1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    :cond_1
    monitor-exit v1
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    new-instance v0, Lcom/hyphenate/chat/EMClient$5;

    invoke-direct {v0, p0, p1}, Lcom/hyphenate/chat/EMClient$5;-><init>(Lcom/hyphenate/chat/EMClient;Lcom/hyphenate/EMConnectionListener;)V

    invoke-virtual {p0, v0}, Lcom/hyphenate/chat/EMClient;->execute(Ljava/lang/Runnable;)V

    goto :goto_0

    :catchall_0
    move-exception v0

    :try_start_1
    monitor-exit v1
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    throw v0
.end method

.method autoLogin(Ljava/lang/String;Ljava/lang/String;Lcom/hyphenate/EMCallBack;)V
    .locals 1

    const/4 v0, 0x1

    invoke-virtual {p0, p1, p2, p3, v0}, Lcom/hyphenate/chat/EMClient;->_login(Ljava/lang/String;Ljava/lang/String;Lcom/hyphenate/EMCallBack;Z)V

    return-void
.end method

.method public callManager()Lcom/hyphenate/chat/EMCallManager;
    .locals 2

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->callManager:Lcom/hyphenate/chat/EMCallManager;

    if-nez v0, :cond_0

    new-instance v0, Lcom/hyphenate/chat/EMCallManager;

    iget-object v1, p0, Lcom/hyphenate/chat/EMClient;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatClient;

    invoke-virtual {v1}, Lcom/hyphenate/chat/adapter/EMAChatClient;->getCallManager()Lcom/hyphenate/chat/adapter/EMACallManager;

    move-result-object v1

    invoke-direct {v0, p0, v1}, Lcom/hyphenate/chat/EMCallManager;-><init>(Lcom/hyphenate/chat/EMClient;Lcom/hyphenate/chat/adapter/EMACallManager;)V

    iput-object v0, p0, Lcom/hyphenate/chat/EMClient;->callManager:Lcom/hyphenate/chat/EMCallManager;

    :cond_0
    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->callManager:Lcom/hyphenate/chat/EMCallManager;

    return-object v0
.end method

.method cancelJob()V
    .locals 4
    .annotation build Landroid/annotation/TargetApi;
        value = 0x15
    .end annotation

    invoke-static {}, Lcom/hyphenate/util/Utils;->isSdk21()Z

    move-result v0

    if-eqz v0, :cond_0

    :try_start_0
    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->mContext:Landroid/content/Context;

    const-string/jumbo v1, "jobscheduler"

    invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/app/job/JobScheduler;

    const/16 v1, 0xb

    invoke-virtual {v0, v1}, Landroid/app/job/JobScheduler;->cancel(I)V

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->mContext:Landroid/content/Context;

    new-instance v1, Landroid/content/Intent;

    iget-object v2, p0, Lcom/hyphenate/chat/EMClient;->mContext:Landroid/content/Context;

    const-class v3, Lcom/hyphenate/chat/EMJobService;

    invoke-direct {v1, v2, v3}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    invoke-virtual {v0, v1}, Landroid/content/Context;->stopService(Landroid/content/Intent;)Z
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    :cond_0
    :goto_0
    return-void

    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method public changeAppkey(Ljava/lang/String;)V
    .locals 2

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatClient;

    invoke-virtual {v0, p1}, Lcom/hyphenate/chat/adapter/EMAChatClient;->changeAppkey(Ljava/lang/String;)Lcom/hyphenate/chat/adapter/EMAError;

    move-result-object v0

    invoke-virtual {v0}, Lcom/hyphenate/chat/adapter/EMAError;->errCode()I

    move-result v1

    if-nez v1, :cond_0

    invoke-virtual {p0}, Lcom/hyphenate/chat/EMClient;->getOptions()Lcom/hyphenate/chat/EMOptions;

    move-result-object v1

    invoke-virtual {v1, p1}, Lcom/hyphenate/chat/EMOptions;->updatePath(Ljava/lang/String;)V

    :cond_0
    invoke-direct {p0, v0}, Lcom/hyphenate/chat/EMClient;->handleError(Lcom/hyphenate/chat/adapter/EMAError;)V

    return-void
.end method

.method public chatManager()Lcom/hyphenate/chat/EMChatManager;
    .locals 2

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->chatManager:Lcom/hyphenate/chat/EMChatManager;

    if-nez v0, :cond_0

    new-instance v0, Lcom/hyphenate/chat/EMChatManager;

    iget-object v1, p0, Lcom/hyphenate/chat/EMClient;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatClient;

    invoke-virtual {v1}, Lcom/hyphenate/chat/adapter/EMAChatClient;->getChatManager()Lcom/hyphenate/chat/adapter/EMAChatManager;

    move-result-object v1

    invoke-direct {v0, p0, v1}, Lcom/hyphenate/chat/EMChatManager;-><init>(Lcom/hyphenate/chat/EMClient;Lcom/hyphenate/chat/adapter/EMAChatManager;)V

    iput-object v0, p0, Lcom/hyphenate/chat/EMClient;->chatManager:Lcom/hyphenate/chat/EMChatManager;

    :cond_0
    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->chatManager:Lcom/hyphenate/chat/EMChatManager;

    return-object v0
.end method

.method public chatroomManager()Lcom/hyphenate/chat/EMChatRoomManager;
    .locals 2

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->chatroomManager:Lcom/hyphenate/chat/EMChatRoomManager;

    if-nez v0, :cond_0

    new-instance v0, Lcom/hyphenate/chat/EMChatRoomManager;

    iget-object v1, p0, Lcom/hyphenate/chat/EMClient;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatClient;

    invoke-virtual {v1}, Lcom/hyphenate/chat/adapter/EMAChatClient;->getChatRoomManager()Lcom/hyphenate/chat/adapter/EMAChatRoomManager;

    move-result-object v1

    invoke-direct {v0, p0, v1}, Lcom/hyphenate/chat/EMChatRoomManager;-><init>(Lcom/hyphenate/chat/EMClient;Lcom/hyphenate/chat/adapter/EMAChatRoomManager;)V

    iput-object v0, p0, Lcom/hyphenate/chat/EMClient;->chatroomManager:Lcom/hyphenate/chat/EMChatRoomManager;

    :cond_0
    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->chatroomManager:Lcom/hyphenate/chat/EMChatRoomManager;

    return-object v0
.end method

.method checkPushAvailable()V
    .locals 1

    invoke-static {}, Lcom/hyphenate/chat/EMPushHelper;->getInstance()Lcom/hyphenate/chat/EMPushHelper;

    move-result-object v0

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMPushHelper;->checkAvailablePushService()Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-static {}, Lcom/hyphenate/chat/EMPushHelper;->getInstance()Lcom/hyphenate/chat/EMPushHelper;

    move-result-object v0

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMPushHelper;->sendDeviceTokenToServer()V

    :goto_0
    return-void

    :cond_0
    invoke-direct {p0}, Lcom/hyphenate/chat/EMClient;->sendEmptyToken()V

    goto :goto_0
.end method

.method public contactManager()Lcom/hyphenate/chat/EMContactManager;
    .locals 2

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->contactManager:Lcom/hyphenate/chat/EMContactManager;

    if-nez v0, :cond_0

    new-instance v0, Lcom/hyphenate/chat/EMContactManager;

    iget-object v1, p0, Lcom/hyphenate/chat/EMClient;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatClient;

    invoke-virtual {v1}, Lcom/hyphenate/chat/adapter/EMAChatClient;->getContactManager()Lcom/hyphenate/chat/adapter/EMAContactManager;

    move-result-object v1

    invoke-direct {v0, p0, v1}, Lcom/hyphenate/chat/EMContactManager;-><init>(Lcom/hyphenate/chat/EMClient;Lcom/hyphenate/chat/adapter/EMAContactManager;)V

    iput-object v0, p0, Lcom/hyphenate/chat/EMClient;->contactManager:Lcom/hyphenate/chat/EMContactManager;

    :cond_0
    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->contactManager:Lcom/hyphenate/chat/EMContactManager;

    return-object v0
.end method

.method public createAccount(Ljava/lang/String;Ljava/lang/String;)V
    .locals 3

    invoke-virtual {p1}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;

    move-result-object v0

    const-string/jumbo v1, "^[a-zA-Z0-9_-]+$"

    invoke-static {v1}, Ljava/util/regex/Pattern;->compile(Ljava/lang/String;)Ljava/util/regex/Pattern;

    move-result-object v1

    invoke-virtual {v1, v0}, Ljava/util/regex/Pattern;->matcher(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher;

    move-result-object v1

    invoke-virtual {v1}, Ljava/util/regex/Matcher;->find()Z

    move-result v1

    if-nez v1, :cond_0

    new-instance v0, Lcom/hyphenate/exceptions/HyphenateException;

    const/16 v1, 0xcd

    const-string/jumbo v2, "illegal user name"

    invoke-direct {v0, v1, v2}, Lcom/hyphenate/exceptions/HyphenateException;-><init>(ILjava/lang/String;)V

    throw v0

    :cond_0
    iget-object v1, p0, Lcom/hyphenate/chat/EMClient;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatClient;

    invoke-virtual {v1, v0, p2}, Lcom/hyphenate/chat/adapter/EMAChatClient;->createAccount(Ljava/lang/String;Ljava/lang/String;)Lcom/hyphenate/chat/adapter/EMAError;

    move-result-object v0

    invoke-direct {p0, v0}, Lcom/hyphenate/chat/EMClient;->handleError(Lcom/hyphenate/chat/adapter/EMAError;)V

    return-void
.end method

.method disconnect()V
    .locals 1

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatClient;

    invoke-virtual {v0}, Lcom/hyphenate/chat/adapter/EMAChatClient;->disconnect()V

    return-void
.end method

.method doStartService()V
    .locals 4

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->mContext:Landroid/content/Context;

    if-nez v0, :cond_0

    :goto_0
    return-void

    :cond_0
    const-string/jumbo v0, "EMClient"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v2, "do start service: context:"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget-object v2, p0, Lcom/hyphenate/chat/EMClient;->mContext:Landroid/content/Context;

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/hyphenate/util/EMLog;->d(Ljava/lang/String;Ljava/lang/String;)V

    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/hyphenate/chat/EMClient;->stopService:Z

    :try_start_0
    new-instance v0, Landroid/content/Intent;

    iget-object v1, p0, Lcom/hyphenate/chat/EMClient;->mContext:Landroid/content/Context;

    const-class v2, Lcom/hyphenate/chat/EMChatService;

    invoke-direct {v0, v1, v2}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    iget-object v1, p0, Lcom/hyphenate/chat/EMClient;->mContext:Landroid/content/Context;

    invoke-virtual {v1, v0}, Landroid/content/Context;->startService(Landroid/content/Intent;)Landroid/content/ComponentName;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    const-string/jumbo v1, "EMClient"

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v3, "exception in start service, e: "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v0}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v1, v0}, Lcom/hyphenate/util/EMLog;->d(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_0
.end method

.method doStopService()V
    .locals 3

    :try_start_0
    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->mContext:Landroid/content/Context;

    if-nez v0, :cond_0

    const-string/jumbo v0, "EMClient"

    const-string/jumbo v1, "applicationContext is null, the server is not started before"

    invoke-static {v0, v1}, Lcom/hyphenate/util/EMLog;->w(Ljava/lang/String;Ljava/lang/String;)V

    :goto_0
    return-void

    :cond_0
    const-string/jumbo v0, "EMClient"

    const-string/jumbo v1, "do stop service"

    invoke-static {v0, v1}, Lcom/hyphenate/util/EMLog;->d(Ljava/lang/String;Ljava/lang/String;)V

    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/hyphenate/chat/EMClient;->stopService:Z

    new-instance v0, Landroid/content/Intent;

    iget-object v1, p0, Lcom/hyphenate/chat/EMClient;->mContext:Landroid/content/Context;

    const-class v2, Lcom/hyphenate/chat/EMChatService;

    invoke-direct {v0, v1, v2}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    iget-object v1, p0, Lcom/hyphenate/chat/EMClient;->mContext:Landroid/content/Context;

    invoke-virtual {v1, v0}, Landroid/content/Context;->stopService(Landroid/content/Intent;)Z
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_0
.end method

.method execute(Ljava/lang/Runnable;)V
    .locals 1

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->executor:Ljava/util/concurrent/ExecutorService;

    invoke-interface {v0, p1}, Ljava/util/concurrent/ExecutorService;->execute(Ljava/lang/Runnable;)V

    return-void
.end method

.method executeOnMainQueue(Ljava/lang/Runnable;)V
    .locals 1

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->mainQueue:Ljava/util/concurrent/ExecutorService;

    invoke-interface {v0, p1}, Ljava/util/concurrent/ExecutorService;->submit(Ljava/lang/Runnable;)Ljava/util/concurrent/Future;

    return-void
.end method

.method forceReconnect()V
    .locals 0

    invoke-virtual {p0}, Lcom/hyphenate/chat/EMClient;->disconnect()V

    invoke-virtual {p0}, Lcom/hyphenate/chat/EMClient;->reconnect()V

    return-void
.end method

.method public getAccessToken()Ljava/lang/String;
    .locals 1

    invoke-virtual {p0}, Lcom/hyphenate/chat/EMClient;->getChatConfigPrivate()Lcom/hyphenate/chat/a/b;

    move-result-object v0

    invoke-virtual {v0}, Lcom/hyphenate/chat/a/b;->n()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getChatConfig()Lcom/hyphenate/chat/EMChatConfig;
    .locals 1

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->chatConfig:Lcom/hyphenate/chat/EMChatConfig;

    return-object v0
.end method

.method getChatConfigPrivate()Lcom/hyphenate/chat/a/b;
    .locals 1

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->mChatConfigPrivate:Lcom/hyphenate/chat/a/b;

    return-object v0
.end method

.method public getContext()Landroid/content/Context;
    .locals 1

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->mContext:Landroid/content/Context;

    return-object v0
.end method

.method getCryptoUtils()Lcom/hyphenate/util/CryptoUtils;
    .locals 1

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->cryptoUtils:Lcom/hyphenate/util/CryptoUtils;

    return-object v0
.end method

.method public getCurrentUser()Ljava/lang/String;
    .locals 2

    invoke-static {}, Lcom/hyphenate/chat/EMSessionManager;->getInstance()Lcom/hyphenate/chat/EMSessionManager;

    move-result-object v0

    iget-object v0, v0, Lcom/hyphenate/chat/EMSessionManager;->currentUser:Lcom/hyphenate/chat/EMContact;

    if-eqz v0, :cond_0

    invoke-static {}, Lcom/hyphenate/chat/EMSessionManager;->getInstance()Lcom/hyphenate/chat/EMSessionManager;

    move-result-object v0

    iget-object v0, v0, Lcom/hyphenate/chat/EMSessionManager;->currentUser:Lcom/hyphenate/chat/EMContact;

    iget-object v0, v0, Lcom/hyphenate/chat/EMContact;->username:Ljava/lang/String;

    if-eqz v0, :cond_0

    invoke-static {}, Lcom/hyphenate/chat/EMSessionManager;->getInstance()Lcom/hyphenate/chat/EMSessionManager;

    move-result-object v0

    iget-object v0, v0, Lcom/hyphenate/chat/EMSessionManager;->currentUser:Lcom/hyphenate/chat/EMContact;

    iget-object v0, v0, Lcom/hyphenate/chat/EMContact;->username:Ljava/lang/String;

    const-string/jumbo v1, ""

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_1

    :cond_0
    invoke-static {}, Lcom/hyphenate/chat/EMSessionManager;->getInstance()Lcom/hyphenate/chat/EMSessionManager;

    move-result-object v0

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMSessionManager;->getLastLoginUser()Ljava/lang/String;

    move-result-object v0

    :goto_0
    return-object v0

    :cond_1
    invoke-static {}, Lcom/hyphenate/chat/EMSessionManager;->getInstance()Lcom/hyphenate/chat/EMSessionManager;

    move-result-object v0

    iget-object v0, v0, Lcom/hyphenate/chat/EMSessionManager;->currentUser:Lcom/hyphenate/chat/EMContact;

    iget-object v0, v0, Lcom/hyphenate/chat/EMContact;->username:Ljava/lang/String;

    goto :goto_0
.end method

.method getEncryptProvider()Lcom/hyphenate/chat/EncryptProvider;
    .locals 2

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->encryptProvider:Lcom/hyphenate/chat/EncryptProvider;

    if-nez v0, :cond_0

    const-string/jumbo v0, "EMClient"

    const-string/jumbo v1, "encrypt provider is not set, create default"

    invoke-static {v0, v1}, Lcom/hyphenate/util/EMLog;->d(Ljava/lang/String;Ljava/lang/String;)V

    new-instance v0, Lcom/hyphenate/chat/EMClient$8;

    invoke-direct {v0, p0}, Lcom/hyphenate/chat/EMClient$8;-><init>(Lcom/hyphenate/chat/EMClient;)V

    iput-object v0, p0, Lcom/hyphenate/chat/EMClient;->encryptProvider:Lcom/hyphenate/chat/EncryptProvider;

    :cond_0
    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->encryptProvider:Lcom/hyphenate/chat/EncryptProvider;

    return-object v0
.end method

.method public getOptions()Lcom/hyphenate/chat/EMOptions;
    .locals 1

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->mChatConfigPrivate:Lcom/hyphenate/chat/a/b;

    invoke-virtual {v0}, Lcom/hyphenate/chat/a/b;->b()Lcom/hyphenate/chat/EMOptions;

    move-result-object v0

    return-object v0
.end method

.method public getRobotsFromServer()Ljava/util/List;
    .locals 1

    invoke-static {}, Lcom/hyphenate/chat/EMExtraService;->getInstance()Lcom/hyphenate/chat/EMExtraService;

    move-result-object v0

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMExtraService;->getRobotsFromServer()Ljava/util/List;

    move-result-object v0

    return-object v0
.end method

.method public groupManager()Lcom/hyphenate/chat/EMGroupManager;
    .locals 2

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->groupManager:Lcom/hyphenate/chat/EMGroupManager;

    if-nez v0, :cond_0

    new-instance v0, Lcom/hyphenate/chat/EMGroupManager;

    iget-object v1, p0, Lcom/hyphenate/chat/EMClient;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatClient;

    invoke-virtual {v1}, Lcom/hyphenate/chat/adapter/EMAChatClient;->getGroupManager()Lcom/hyphenate/chat/adapter/EMAGroupManager;

    move-result-object v1

    invoke-direct {v0, p0, v1}, Lcom/hyphenate/chat/EMGroupManager;-><init>(Lcom/hyphenate/chat/EMClient;Lcom/hyphenate/chat/adapter/EMAGroupManager;)V

    iput-object v0, p0, Lcom/hyphenate/chat/EMClient;->groupManager:Lcom/hyphenate/chat/EMGroupManager;

    :cond_0
    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->groupManager:Lcom/hyphenate/chat/EMGroupManager;

    return-object v0
.end method

.method public init(Landroid/content/Context;Lcom/hyphenate/chat/EMOptions;)V
    .locals 7

    const/4 v4, 0x1

    iget-boolean v0, p0, Lcom/hyphenate/chat/EMClient;->sdkInited:Z

    if-eqz v0, :cond_0

    :goto_0
    return-void

    :cond_0
    new-instance v6, Lcom/hyphenate/analytics/EMTimeTag;

    invoke-direct {v6}, Lcom/hyphenate/analytics/EMTimeTag;-><init>()V

    invoke-virtual {v6}, Lcom/hyphenate/analytics/EMTimeTag;->start()V

    invoke-virtual {p1}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    iput-object v0, p0, Lcom/hyphenate/chat/EMClient;->mContext:Landroid/content/Context;

    invoke-direct {p0}, Lcom/hyphenate/chat/EMClient;->registerActivityLifecycleCallbacks()V

    new-instance v0, Lcom/hyphenate/chat/a/b;

    invoke-direct {v0}, Lcom/hyphenate/chat/a/b;-><init>()V

    iput-object v0, p0, Lcom/hyphenate/chat/EMClient;->mChatConfigPrivate:Lcom/hyphenate/chat/a/b;

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->mChatConfigPrivate:Lcom/hyphenate/chat/a/b;

    invoke-virtual {v0, p1, p2}, Lcom/hyphenate/chat/a/b;->a(Landroid/content/Context;Lcom/hyphenate/chat/EMOptions;)Z

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->mChatConfigPrivate:Lcom/hyphenate/chat/a/b;

    invoke-virtual {p2, v0}, Lcom/hyphenate/chat/EMOptions;->setConfig(Lcom/hyphenate/chat/a/b;)V

    new-instance v0, Lcom/hyphenate/chat/EMChatConfig;

    iget-object v1, p0, Lcom/hyphenate/chat/EMClient;->mChatConfigPrivate:Lcom/hyphenate/chat/a/b;

    invoke-direct {v0, v1}, Lcom/hyphenate/chat/EMChatConfig;-><init>(Lcom/hyphenate/chat/a/b;)V

    iput-object v0, p0, Lcom/hyphenate/chat/EMClient;->chatConfig:Lcom/hyphenate/chat/EMChatConfig;

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->mChatConfigPrivate:Lcom/hyphenate/chat/a/b;

    iget-object v0, v0, Lcom/hyphenate/chat/a/b;->a:Lcom/hyphenate/chat/adapter/EMAChatConfig;

    invoke-static {v0}, Lcom/hyphenate/chat/adapter/EMAChatClient;->create(Lcom/hyphenate/chat/adapter/EMAChatConfig;)Lcom/hyphenate/chat/adapter/EMAChatClient;

    move-result-object v0

    iput-object v0, p0, Lcom/hyphenate/chat/EMClient;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatClient;

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatClient;

    iget-object v1, p0, Lcom/hyphenate/chat/EMClient;->connectionListener:Lcom/hyphenate/chat/EMClient$MyConnectionListener;

    invoke-virtual {v0, v1}, Lcom/hyphenate/chat/adapter/EMAChatClient;->addConnectionListener(Lcom/hyphenate/chat/adapter/EMAConnectionListener;)V

    invoke-static {}, Ljava/util/concurrent/Executors;->newCachedThreadPool()Ljava/util/concurrent/ExecutorService;

    move-result-object v0

    iput-object v0, p0, Lcom/hyphenate/chat/EMClient;->executor:Ljava/util/concurrent/ExecutorService;

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->cryptoUtils:Lcom/hyphenate/util/CryptoUtils;

    invoke-virtual {v0, v4}, Lcom/hyphenate/util/CryptoUtils;->init(I)V

    invoke-direct {p0}, Lcom/hyphenate/chat/EMClient;->initManagers()V

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->mContext:Landroid/content/Context;

    invoke-virtual {p0}, Lcom/hyphenate/chat/EMClient;->getChatConfigPrivate()Lcom/hyphenate/chat/a/b;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/hyphenate/analytics/EMActiveCollector;->sendActivePacket(Landroid/content/Context;Lcom/hyphenate/chat/a/b;)V

    invoke-static {}, Lcom/hyphenate/chat/EMSessionManager;->getInstance()Lcom/hyphenate/chat/EMSessionManager;

    move-result-object v0

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMSessionManager;->getLastLoginUser()Ljava/lang/String;

    move-result-object v2

    const-string/jumbo v0, "EMClient"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v3, "is autoLogin : "

    invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {p2}, Lcom/hyphenate/chat/EMOptions;->getAutoLogin()Z

    move-result v3

    invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/hyphenate/util/EMLog;->e(Ljava/lang/String;Ljava/lang/String;)V

    const-string/jumbo v0, "EMClient"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v3, "lastLoginUser : "

    invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/hyphenate/util/EMLog;->e(Ljava/lang/String;Ljava/lang/String;)V

    const-string/jumbo v0, "EMClient"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v3, "hyphenate SDK is initialized with version : "

    invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {p0}, Lcom/hyphenate/chat/EMClient;->getChatConfigPrivate()Lcom/hyphenate/chat/a/b;

    move-result-object v3

    invoke-virtual {v3}, Lcom/hyphenate/chat/a/b;->e()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/hyphenate/util/EMLog;->e(Ljava/lang/String;Ljava/lang/String;)V

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->mContext:Landroid/content/Context;

    const-string/jumbo v1, "power"

    invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/os/PowerManager;

    const-string/jumbo v1, "emclient"

    invoke-virtual {v0, v4, v1}, Landroid/os/PowerManager;->newWakeLock(ILjava/lang/String;)Landroid/os/PowerManager$WakeLock;

    move-result-object v0

    iput-object v0, p0, Lcom/hyphenate/chat/EMClient;->wakeLock:Landroid/os/PowerManager$WakeLock;

    iput-boolean v4, p0, Lcom/hyphenate/chat/EMClient;->sdkInited:Z

    invoke-virtual {p2}, Lcom/hyphenate/chat/EMOptions;->getAutoLogin()Z

    move-result v0

    if-eqz v0, :cond_1

    invoke-virtual {p0}, Lcom/hyphenate/chat/EMClient;->isLoggedInBefore()Z

    move-result v0

    if-eqz v0, :cond_1

    invoke-static {}, Lcom/hyphenate/chat/EMSessionManager;->getInstance()Lcom/hyphenate/chat/EMSessionManager;

    move-result-object v0

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMSessionManager;->getLastLoginPwd()Ljava/lang/String;

    move-result-object v4

    invoke-static {}, Lcom/hyphenate/chat/EMSessionManager;->getInstance()Lcom/hyphenate/chat/EMSessionManager;

    move-result-object v0

    new-instance v1, Lcom/hyphenate/chat/EMContact;

    invoke-direct {v1, v2}, Lcom/hyphenate/chat/EMContact;-><init>(Ljava/lang/String;)V

    iput-object v1, v0, Lcom/hyphenate/chat/EMSessionManager;->currentUser:Lcom/hyphenate/chat/EMContact;

    new-instance v5, Lcom/hyphenate/chat/EMClient$1;

    invoke-direct {v5, p0, v2}, Lcom/hyphenate/chat/EMClient$1;-><init>(Lcom/hyphenate/chat/EMClient;Ljava/lang/String;)V

    new-instance v0, Lcom/hyphenate/chat/EMClient$2;

    move-object v1, p0

    move-object v3, v2

    invoke-direct/range {v0 .. v5}, Lcom/hyphenate/chat/EMClient$2;-><init>(Lcom/hyphenate/chat/EMClient;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/hyphenate/EMCallBack;)V

    invoke-virtual {p0, v0}, Lcom/hyphenate/chat/EMClient;->execute(Ljava/lang/Runnable;)V

    :cond_1
    invoke-virtual {v6}, Lcom/hyphenate/analytics/EMTimeTag;->stop()J

    const-string/jumbo v0, "EMClient"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v2, "[Collector][sdk init]init time is : "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v6}, Lcom/hyphenate/analytics/EMTimeTag;->timeStr()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/hyphenate/util/EMLog;->e(Ljava/lang/String;Ljava/lang/String;)V

    goto/16 :goto_0
.end method

.method public isConnected()Z
    .locals 1

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatClient;

    invoke-virtual {v0}, Lcom/hyphenate/chat/adapter/EMAChatClient;->isConnected()Z

    move-result v0

    return v0
.end method

.method public isLoggedInBefore()Z
    .locals 3

    invoke-static {}, Lcom/hyphenate/chat/EMSessionManager;->getInstance()Lcom/hyphenate/chat/EMSessionManager;

    move-result-object v0

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMSessionManager;->getLastLoginUser()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMSessionManager;->getLastLoginPwd()Ljava/lang/String;

    move-result-object v0

    if-eqz v1, :cond_0

    if-eqz v0, :cond_0

    const-string/jumbo v2, ""

    invoke-virtual {v1, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-nez v1, :cond_0

    const-string/jumbo v1, ""

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public login(Ljava/lang/String;Ljava/lang/String;Lcom/hyphenate/EMCallBack;)V
    .locals 2

    invoke-virtual {p0}, Lcom/hyphenate/chat/EMClient;->getChatConfigPrivate()Lcom/hyphenate/chat/a/b;

    move-result-object v0

    invoke-virtual {v0}, Lcom/hyphenate/chat/a/b;->l()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-eqz v0, :cond_0

    new-instance v0, Ljava/lang/RuntimeException;

    const-string/jumbo v1, "please setup your appkey either in AndroidManifest.xml or through the EMOptions"

    invoke-direct {v0, v1}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V

    throw v0

    :cond_0
    if-nez p3, :cond_1

    new-instance v0, Ljava/lang/IllegalArgumentException;

    const-string/jumbo v1, "callback is null!"

    invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v0

    :cond_1
    if-eqz p1, :cond_2

    if-eqz p2, :cond_2

    const-string/jumbo v0, ""

    invoke-virtual {p1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_2

    const-string/jumbo v0, ""

    invoke-virtual {p2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_3

    :cond_2
    new-instance v0, Ljava/lang/IllegalArgumentException;

    const-string/jumbo v1, "username or password is null or empty!"

    invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v0

    :cond_3
    invoke-virtual {p1}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;

    move-result-object v0

    const/4 v1, 0x0

    invoke-virtual {p0, v0, p2, p3, v1}, Lcom/hyphenate/chat/EMClient;->_login(Ljava/lang/String;Ljava/lang/String;Lcom/hyphenate/EMCallBack;Z)V

    return-void
.end method

.method loginWithToken(Ljava/lang/String;Ljava/lang/String;Lcom/hyphenate/EMCallBack;)V
    .locals 0

    return-void
.end method

.method public logout(Z)I
    .locals 1

    :try_start_0
    invoke-static {}, Lcom/hyphenate/chat/EMPushHelper;->getInstance()Lcom/hyphenate/chat/EMPushHelper;

    move-result-object v0

    invoke-virtual {v0, p1}, Lcom/hyphenate/chat/EMPushHelper;->onDestroy(Z)V
    :try_end_0
    .catch Lcom/hyphenate/exceptions/HyphenateException; {:try_start_0 .. :try_end_0} :catch_0

    invoke-virtual {p0}, Lcom/hyphenate/chat/EMClient;->logout()V

    const/4 v0, 0x0

    :goto_0
    return v0

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Lcom/hyphenate/exceptions/HyphenateException;->printStackTrace()V

    const/16 v0, 0xd4

    goto :goto_0
.end method

.method logout()V
    .locals 2

    const-string/jumbo v0, "EMClient"

    const-string/jumbo v1, " SDK Logout"

    invoke-static {v0, v1}, Lcom/hyphenate/util/EMLog;->d(Ljava/lang/String;Ljava/lang/String;)V

    :try_start_0
    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->connectivityBroadcastReceiver:Landroid/content/BroadcastReceiver;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->mContext:Landroid/content/Context;

    iget-object v1, p0, Lcom/hyphenate/chat/EMClient;->connectivityBroadcastReceiver:Landroid/content/BroadcastReceiver;

    invoke-virtual {v0, v1}, Landroid/content/Context;->unregisterReceiver(Landroid/content/BroadcastReceiver;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1

    :cond_0
    :goto_0
    invoke-static {}, Lcom/hyphenate/chat/EMSessionManager;->getInstance()Lcom/hyphenate/chat/EMSessionManager;

    move-result-object v0

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMSessionManager;->clearLastLoginUser()V

    invoke-static {}, Lcom/hyphenate/chat/EMSessionManager;->getInstance()Lcom/hyphenate/chat/EMSessionManager;

    move-result-object v0

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMSessionManager;->clearLastLoginPwd()V

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->smartHeartbeat:Lcom/hyphenate/chat/EMSmartHeartBeat;

    if-eqz v0, :cond_1

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->smartHeartbeat:Lcom/hyphenate/chat/EMSmartHeartBeat;

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMSmartHeartBeat;->stop()V

    :cond_1
    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->wakeLock:Landroid/os/PowerManager$WakeLock;

    invoke-virtual {v0}, Landroid/os/PowerManager$WakeLock;->isHeld()Z

    move-result v0

    if-eqz v0, :cond_2

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->wakeLock:Landroid/os/PowerManager$WakeLock;

    invoke-virtual {v0}, Landroid/os/PowerManager$WakeLock;->release()V

    :cond_2
    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatClient;

    if-eqz v0, :cond_3

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatClient;

    invoke-virtual {v0}, Lcom/hyphenate/chat/adapter/EMAChatClient;->logout()V

    :cond_3
    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->chatManager:Lcom/hyphenate/chat/EMChatManager;

    if-eqz v0, :cond_4

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->chatManager:Lcom/hyphenate/chat/EMChatManager;

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMChatManager;->onLogout()V

    :cond_4
    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->groupManager:Lcom/hyphenate/chat/EMGroupManager;

    if-eqz v0, :cond_5

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->groupManager:Lcom/hyphenate/chat/EMGroupManager;

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMGroupManager;->onLogout()V

    :cond_5
    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->contactManager:Lcom/hyphenate/chat/EMContactManager;

    if-eqz v0, :cond_6

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->contactManager:Lcom/hyphenate/chat/EMContactManager;

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMContactManager;->onLogout()V

    :cond_6
    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->chatroomManager:Lcom/hyphenate/chat/EMChatRoomManager;

    if-eqz v0, :cond_7

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->chatroomManager:Lcom/hyphenate/chat/EMChatRoomManager;

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMChatRoomManager;->onLogout()V

    :cond_7
    :try_start_1
    invoke-static {}, Lcom/hyphenate/chat/a/a;->a()Lcom/hyphenate/chat/a/a;

    move-result-object v0

    invoke-virtual {v0}, Lcom/hyphenate/chat/a/a;->f()V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    :goto_1
    invoke-static {}, Lcom/hyphenate/chat/a/b;->a()Z

    move-result v0

    if-eqz v0, :cond_8

    invoke-static {}, Lcom/hyphenate/a/a;->c()V

    :cond_8
    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->mContext:Landroid/content/Context;

    if-eqz v0, :cond_9

    invoke-static {}, Lcom/hyphenate/chat/EMMonitor;->getInstance()Lcom/hyphenate/chat/EMMonitor;

    move-result-object v0

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMMonitor;->getMonitorDB()Lcom/hyphenate/chat/a/d;

    move-result-object v0

    iget-object v1, p0, Lcom/hyphenate/chat/EMClient;->mContext:Landroid/content/Context;

    invoke-virtual {v1}, Landroid/content/Context;->getPackageName()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/hyphenate/chat/a/d;->b(Ljava/lang/String;)V

    :cond_9
    invoke-virtual {p0}, Lcom/hyphenate/chat/EMClient;->cancelJob()V

    invoke-virtual {p0}, Lcom/hyphenate/chat/EMClient;->doStopService()V

    return-void

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_1

    :catch_1
    move-exception v0

    goto/16 :goto_0
.end method

.method logout(Lcom/hyphenate/EMCallBack;)V
    .locals 2

    new-instance v0, Lcom/hyphenate/chat/EMClient$4;

    invoke-direct {v0, p0, p1}, Lcom/hyphenate/chat/EMClient$4;-><init>(Lcom/hyphenate/chat/EMClient;Lcom/hyphenate/EMCallBack;)V

    const/16 v1, 0x9

    invoke-virtual {v0, v1}, Ljava/lang/Thread;->setPriority(I)V

    invoke-virtual {v0}, Ljava/lang/Thread;->start()V

    return-void
.end method

.method public logout(ZLcom/hyphenate/EMCallBack;)V
    .locals 1

    new-instance v0, Lcom/hyphenate/chat/EMClient$3;

    invoke-direct {v0, p0, p1, p2}, Lcom/hyphenate/chat/EMClient$3;-><init>(Lcom/hyphenate/chat/EMClient;ZLcom/hyphenate/EMCallBack;)V

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMClient$3;->start()V

    return-void
.end method

.method onNetworkChanged()V
    .locals 2

    :try_start_0
    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->mContext:Landroid/content/Context;

    invoke-static {v0}, Lcom/hyphenate/util/NetUtils;->isWifiConnection(Landroid/content/Context;)Z

    move-result v0

    if-eqz v0, :cond_0

    const-string/jumbo v0, "EMClient"

    const-string/jumbo v1, "has wifi connection"

    invoke-static {v0, v1}, Lcom/hyphenate/util/EMLog;->d(Ljava/lang/String;Ljava/lang/String;)V

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatClient;

    sget-object v1, Lcom/hyphenate/chat/adapter/EMAChatClient$EMANetwork;->NETWORK_WIFI:Lcom/hyphenate/chat/adapter/EMAChatClient$EMANetwork;

    invoke-virtual {v0, v1}, Lcom/hyphenate/chat/adapter/EMAChatClient;->onNetworkChanged(Lcom/hyphenate/chat/adapter/EMAChatClient$EMANetwork;)V

    :goto_0
    return-void

    :cond_0
    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->mContext:Landroid/content/Context;

    invoke-static {v0}, Lcom/hyphenate/util/NetUtils;->isMobileConnection(Landroid/content/Context;)Z

    move-result v0

    if-eqz v0, :cond_1

    const-string/jumbo v0, "EMClient"

    const-string/jumbo v1, "has mobile connection"

    invoke-static {v0, v1}, Lcom/hyphenate/util/EMLog;->d(Ljava/lang/String;Ljava/lang/String;)V

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatClient;

    sget-object v1, Lcom/hyphenate/chat/adapter/EMAChatClient$EMANetwork;->NETWORK_MOBILE:Lcom/hyphenate/chat/adapter/EMAChatClient$EMANetwork;

    invoke-virtual {v0, v1}, Lcom/hyphenate/chat/adapter/EMAChatClient;->onNetworkChanged(Lcom/hyphenate/chat/adapter/EMAChatClient$EMANetwork;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_0

    :cond_1
    :try_start_1
    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->mContext:Landroid/content/Context;

    invoke-static {v0}, Lcom/hyphenate/util/NetUtils;->isEthernetConnection(Landroid/content/Context;)Z

    move-result v0

    if-eqz v0, :cond_2

    const-string/jumbo v0, "EMClient"

    const-string/jumbo v1, "has ethernet connection"

    invoke-static {v0, v1}, Lcom/hyphenate/util/EMLog;->d(Ljava/lang/String;Ljava/lang/String;)V

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatClient;

    sget-object v1, Lcom/hyphenate/chat/adapter/EMAChatClient$EMANetwork;->NETWORK_CABLE:Lcom/hyphenate/chat/adapter/EMAChatClient$EMANetwork;

    invoke-virtual {v0, v1}, Lcom/hyphenate/chat/adapter/EMAChatClient;->onNetworkChanged(Lcom/hyphenate/chat/adapter/EMAChatClient$EMANetwork;)V

    goto :goto_0

    :cond_2
    const-string/jumbo v0, "EMClient"

    const-string/jumbo v1, "no data connection"

    invoke-static {v0, v1}, Lcom/hyphenate/util/EMLog;->d(Ljava/lang/String;Ljava/lang/String;)V

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatClient;

    sget-object v1, Lcom/hyphenate/chat/adapter/EMAChatClient$EMANetwork;->NETWORK_NONE:Lcom/hyphenate/chat/adapter/EMAChatClient$EMANetwork;

    invoke-virtual {v0, v1}, Lcom/hyphenate/chat/adapter/EMAChatClient;->onNetworkChanged(Lcom/hyphenate/chat/adapter/EMAChatClient$EMANetwork;)V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    goto :goto_0
.end method

.method onNetworkChanged(Lcom/hyphenate/chat/adapter/EMAChatClient$EMANetwork;)V
    .locals 1

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatClient;

    invoke-virtual {v0, p1}, Lcom/hyphenate/chat/adapter/EMAChatClient;->onNetworkChanged(Lcom/hyphenate/chat/adapter/EMAChatClient$EMANetwork;)V

    return-void
.end method

.method onNewLogin()V
    .locals 4

    const-string/jumbo v0, "EMClient"

    const-string/jumbo v1, "on new login created"

    invoke-static {v0, v1}, Lcom/hyphenate/util/EMLog;->d(Ljava/lang/String;Ljava/lang/String;)V

    invoke-static {}, Lcom/hyphenate/chat/EMSessionManager;->getInstance()Lcom/hyphenate/chat/EMSessionManager;

    move-result-object v0

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMSessionManager;->getLastLoginUser()Ljava/lang/String;

    move-result-object v0

    invoke-static {}, Lcom/hyphenate/util/PathUtil;->getInstance()Lcom/hyphenate/util/PathUtil;

    move-result-object v1

    invoke-virtual {p0}, Lcom/hyphenate/chat/EMClient;->getChatConfigPrivate()Lcom/hyphenate/chat/a/b;

    move-result-object v2

    invoke-virtual {v2}, Lcom/hyphenate/chat/a/b;->l()Ljava/lang/String;

    move-result-object v2

    iget-object v3, p0, Lcom/hyphenate/chat/EMClient;->mContext:Landroid/content/Context;

    invoke-virtual {v1, v2, v0, v3}, Lcom/hyphenate/util/PathUtil;->initDirs(Ljava/lang/String;Ljava/lang/String;Landroid/content/Context;)V

    iget-object v1, p0, Lcom/hyphenate/chat/EMClient;->mChatConfigPrivate:Lcom/hyphenate/chat/a/b;

    invoke-static {v0, v1}, Lcom/hyphenate/chat/a/c;->a(Ljava/lang/String;Lcom/hyphenate/chat/a/b;)V

    invoke-static {}, Lcom/hyphenate/chat/a/c;->a()Lcom/hyphenate/chat/a/c;

    move-result-object v0

    invoke-virtual {v0}, Lcom/hyphenate/chat/a/c;->c()V

    invoke-virtual {p0}, Lcom/hyphenate/chat/EMClient;->saveAppname()V

    invoke-static {}, Lcom/hyphenate/chat/EMPushHelper;->getInstance()Lcom/hyphenate/chat/EMPushHelper;

    move-result-object v0

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMPushHelper;->onInit()V

    invoke-static {}, Lcom/hyphenate/chat/a/a;->a()Lcom/hyphenate/chat/a/a;

    move-result-object v0

    iget-object v1, p0, Lcom/hyphenate/chat/EMClient;->mChatConfigPrivate:Lcom/hyphenate/chat/a/b;

    invoke-virtual {v0, v1}, Lcom/hyphenate/chat/a/a;->a(Lcom/hyphenate/chat/a/b;)V

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->mContext:Landroid/content/Context;

    iget-object v1, p0, Lcom/hyphenate/chat/EMClient;->connectivityBroadcastReceiver:Landroid/content/BroadcastReceiver;

    new-instance v2, Landroid/content/IntentFilter;

    const-string/jumbo v3, "android.net.conn.CONNECTIVITY_CHANGE"

    invoke-direct {v2, v3}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0, v1, v2}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->smartHeartbeat:Lcom/hyphenate/chat/EMSmartHeartBeat;

    if-nez v0, :cond_0

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->mContext:Landroid/content/Context;

    invoke-static {v0}, Lcom/hyphenate/chat/EMSmartHeartBeat;->create(Landroid/content/Context;)Lcom/hyphenate/chat/EMSmartHeartBeat;

    move-result-object v0

    iput-object v0, p0, Lcom/hyphenate/chat/EMClient;->smartHeartbeat:Lcom/hyphenate/chat/EMSmartHeartBeat;

    :cond_0
    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->smartHeartbeat:Lcom/hyphenate/chat/EMSmartHeartBeat;

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMSmartHeartBeat;->onInit()V

    invoke-virtual {p0}, Lcom/hyphenate/chat/EMClient;->getChatConfigPrivate()Lcom/hyphenate/chat/a/b;

    move-result-object v0

    iget-object v0, v0, Lcom/hyphenate/chat/a/b;->a:Lcom/hyphenate/chat/adapter/EMAChatConfig;

    invoke-virtual {v0}, Lcom/hyphenate/chat/adapter/EMAChatConfig;->hasHeartBeatCustomizedParams()Z

    move-result v0

    if-eqz v0, :cond_1

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->smartHeartbeat:Lcom/hyphenate/chat/EMSmartHeartBeat;

    invoke-virtual {p0}, Lcom/hyphenate/chat/EMClient;->getChatConfigPrivate()Lcom/hyphenate/chat/a/b;

    move-result-object v1

    iget-object v1, v1, Lcom/hyphenate/chat/a/b;->a:Lcom/hyphenate/chat/adapter/EMAChatConfig;

    invoke-virtual {v1}, Lcom/hyphenate/chat/adapter/EMAChatConfig;->getWifiHeartBeatCustomizedParams()Lcom/hyphenate/chat/adapter/EMAHeartBeatCustomizedParams;

    move-result-object v1

    invoke-virtual {p0}, Lcom/hyphenate/chat/EMClient;->getChatConfigPrivate()Lcom/hyphenate/chat/a/b;

    move-result-object v2

    iget-object v2, v2, Lcom/hyphenate/chat/a/b;->a:Lcom/hyphenate/chat/adapter/EMAChatConfig;

    invoke-virtual {v2}, Lcom/hyphenate/chat/adapter/EMAChatConfig;->getMobileHeartBeatCustomizedParams()Lcom/hyphenate/chat/adapter/EMAHeartBeatCustomizedParams;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Lcom/hyphenate/chat/EMSmartHeartBeat;->setCustomizedParams(Lcom/hyphenate/chat/adapter/EMAHeartBeatCustomizedParams;Lcom/hyphenate/chat/adapter/EMAHeartBeatCustomizedParams;)V

    :cond_1
    invoke-virtual {p0}, Lcom/hyphenate/chat/EMClient;->scheduleJob()V

    return-void
.end method

.method reconnect()V
    .locals 1

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->wakeLock:Landroid/os/PowerManager$WakeLock;

    invoke-virtual {v0}, Landroid/os/PowerManager$WakeLock;->acquire()V

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatClient;

    invoke-virtual {v0}, Lcom/hyphenate/chat/adapter/EMAChatClient;->reconnect()V

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->wakeLock:Landroid/os/PowerManager$WakeLock;

    invoke-virtual {v0}, Landroid/os/PowerManager$WakeLock;->isHeld()Z

    move-result v0

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->wakeLock:Landroid/os/PowerManager$WakeLock;

    invoke-virtual {v0}, Landroid/os/PowerManager$WakeLock;->release()V

    :cond_0
    return-void
.end method

.method public removeConnectionListener(Lcom/hyphenate/EMConnectionListener;)V
    .locals 2

    if-nez p1, :cond_0

    :goto_0
    return-void

    :cond_0
    iget-object v1, p0, Lcom/hyphenate/chat/EMClient;->connectionListeners:Ljava/util/List;

    monitor-enter v1

    :try_start_0
    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->connectionListeners:Ljava/util/List;

    invoke-interface {v0, p1}, Ljava/util/List;->remove(Ljava/lang/Object;)Z

    monitor-exit v1

    goto :goto_0

    :catchall_0
    move-exception v0

    monitor-exit v1
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v0
.end method

.method saveAppname()V
    .locals 2

    invoke-static {}, Lcom/hyphenate/chat/EMMonitor;->getInstance()Lcom/hyphenate/chat/EMMonitor;

    move-result-object v0

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMMonitor;->getMonitorDB()Lcom/hyphenate/chat/a/d;

    move-result-object v0

    iget-object v1, p0, Lcom/hyphenate/chat/EMClient;->mContext:Landroid/content/Context;

    invoke-virtual {v1}, Landroid/content/Context;->getPackageName()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/hyphenate/chat/a/d;->a(Ljava/lang/String;)V

    return-void
.end method

.method scheduleJob()V
    .locals 5
    .annotation build Landroid/annotation/TargetApi;
        value = 0x15
    .end annotation

    invoke-static {}, Lcom/hyphenate/util/Utils;->isSdk21()Z

    move-result v0

    if-eqz v0, :cond_0

    :try_start_0
    new-instance v0, Landroid/content/Intent;

    invoke-virtual {p0}, Lcom/hyphenate/chat/EMClient;->getContext()Landroid/content/Context;

    move-result-object v1

    const-class v2, Lcom/hyphenate/chat/EMJobService;

    invoke-direct {v0, v1, v2}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    iget-object v1, p0, Lcom/hyphenate/chat/EMClient;->mContext:Landroid/content/Context;

    invoke-virtual {v1, v0}, Landroid/content/Context;->startService(Landroid/content/Intent;)Landroid/content/ComponentName;

    new-instance v1, Landroid/app/job/JobInfo$Builder;

    const/16 v0, 0xb

    new-instance v2, Landroid/content/ComponentName;

    invoke-virtual {p0}, Lcom/hyphenate/chat/EMClient;->getContext()Landroid/content/Context;

    move-result-object v3

    const-class v4, Lcom/hyphenate/chat/EMJobService;

    invoke-direct {v2, v3, v4}, Landroid/content/ComponentName;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    invoke-direct {v1, v0, v2}, Landroid/app/job/JobInfo$Builder;-><init>(ILandroid/content/ComponentName;)V

    const-wide/32 v2, 0xea60

    invoke-virtual {v1, v2, v3}, Landroid/app/job/JobInfo$Builder;->setPeriodic(J)Landroid/app/job/JobInfo$Builder;

    const/4 v0, 0x1

    invoke-virtual {v1, v0}, Landroid/app/job/JobInfo$Builder;->setRequiredNetworkType(I)Landroid/app/job/JobInfo$Builder;

    const/4 v0, 0x1

    invoke-virtual {v1, v0}, Landroid/app/job/JobInfo$Builder;->setPersisted(Z)Landroid/app/job/JobInfo$Builder;

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->mContext:Landroid/content/Context;

    const-string/jumbo v2, "jobscheduler"

    invoke-virtual {v0, v2}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/app/job/JobScheduler;

    invoke-virtual {v1}, Landroid/app/job/JobInfo$Builder;->build()Landroid/app/job/JobInfo;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/app/job/JobScheduler;->schedule(Landroid/app/job/JobInfo;)I
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    :cond_0
    :goto_0
    return-void

    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method sendPing(ZJ)Z
    .locals 2

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatClient;

    invoke-virtual {v0, p1, p2, p3}, Lcom/hyphenate/chat/adapter/EMAChatClient;->sendPing(ZJ)Z

    move-result v0

    return v0
.end method

.method setAppStateListener(Lcom/hyphenate/chat/EMClient$AppStateListener;)V
    .locals 0

    iput-object p1, p0, Lcom/hyphenate/chat/EMClient;->appStateListener:Lcom/hyphenate/chat/EMClient$AppStateListener;

    return-void
.end method

.method public setDebugMode(Z)V
    .locals 1

    iget-boolean v0, p0, Lcom/hyphenate/chat/EMClient;->sdkInited:Z

    if-eqz v0, :cond_0

    invoke-static {}, Lcom/hyphenate/chat/a/a;->a()Lcom/hyphenate/chat/a/a;

    move-result-object v0

    invoke-virtual {v0}, Lcom/hyphenate/chat/a/a;->e()Ljava/lang/String;

    move-result-object v0

    if-eqz v0, :cond_0

    invoke-static {v0}, Ljava/lang/Boolean;->parseBoolean(Ljava/lang/String;)Z

    move-result p1

    :cond_0
    sput-boolean p1, Lcom/hyphenate/util/EMLog;->debugMode:Z

    invoke-virtual {p0}, Lcom/hyphenate/chat/EMClient;->getChatConfigPrivate()Lcom/hyphenate/chat/a/b;

    move-result-object v0

    invoke-virtual {v0, p1}, Lcom/hyphenate/chat/a/b;->c(Z)V

    return-void
.end method

.method setEncryptProvider(Lcom/hyphenate/chat/EncryptProvider;)V
    .locals 0

    iput-object p1, p0, Lcom/hyphenate/chat/EMClient;->encryptProvider:Lcom/hyphenate/chat/EncryptProvider;

    return-void
.end method

.method setNatvieNetworkCallback()V
    .locals 2

    new-instance v0, Lcom/hyphenate/chat/EMClient$7;

    invoke-direct {v0, p0}, Lcom/hyphenate/chat/EMClient$7;-><init>(Lcom/hyphenate/chat/EMClient;)V

    iget-object v1, p0, Lcom/hyphenate/chat/EMClient;->mChatConfigPrivate:Lcom/hyphenate/chat/a/b;

    iget-object v1, v1, Lcom/hyphenate/chat/a/b;->a:Lcom/hyphenate/chat/adapter/EMAChatConfig;

    invoke-virtual {v1, v0}, Lcom/hyphenate/chat/adapter/EMAChatConfig;->setNetCallback(Lcom/hyphenate/chat/adapter/EMANetCallback;)V

    return-void
.end method

.method setPresence(I)V
    .locals 1

    iget-object v0, p0, Lcom/hyphenate/chat/EMClient;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatClient;

    invoke-virtual {v0, p1}, Lcom/hyphenate/chat/adapter/EMAChatClient;->setPresence(I)V

    return-void
.end method

.method public updateCurrentUserNick(Ljava/lang/String;)Z
    .locals 7

    const/4 v1, 0x0

    invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-eqz v0, :cond_0

    const-string/jumbo v0, "EMClient"

    const-string/jumbo v2, "nick name is null or empty"

    invoke-static {v0, v2}, Lcom/hyphenate/util/EMLog;->e(Ljava/lang/String;Ljava/lang/String;)V

    move v0, v1

    :goto_0
    return v0

    :cond_0
    invoke-virtual {p0}, Lcom/hyphenate/chat/EMClient;->getCurrentUser()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v2

    if-eqz v2, :cond_1

    const-string/jumbo v0, "EMClient"

    const-string/jumbo v2, "currentUser is null or empty"

    invoke-static {v0, v2}, Lcom/hyphenate/util/EMLog;->e(Ljava/lang/String;Ljava/lang/String;)V

    move v0, v1

    goto :goto_0

    :cond_1
    invoke-static {}, Lcom/hyphenate/chat/EMClient;->getInstance()Lcom/hyphenate/chat/EMClient;

    move-result-object v2

    invoke-virtual {v2}, Lcom/hyphenate/chat/EMClient;->getAccessToken()Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v3

    if-eqz v3, :cond_2

    const-string/jumbo v0, "EMClient"

    const-string/jumbo v2, "token is null or empty"

    invoke-static {v0, v2}, Lcom/hyphenate/util/EMLog;->e(Ljava/lang/String;Ljava/lang/String;)V

    move v0, v1

    goto :goto_0

    :cond_2
    invoke-virtual {p0}, Lcom/hyphenate/chat/EMClient;->getChatConfigPrivate()Lcom/hyphenate/chat/a/b;

    move-result-object v3

    invoke-virtual {v3}, Lcom/hyphenate/chat/a/b;->f()Ljava/lang/String;

    move-result-object v3

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string/jumbo v3, "/"

    invoke-virtual {v4, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string/jumbo v3, "users/"

    invoke-virtual {v4, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    const-string/jumbo v3, "Authorization"

    new-instance v5, Ljava/lang/StringBuilder;

    invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v6, "Bearer "

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-interface {v0, v3, v2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    new-instance v2, Lorg/json/JSONObject;

    invoke-direct {v2}, Lorg/json/JSONObject;-><init>()V

    :try_start_0
    const-string/jumbo v3, "nickname"

    invoke-virtual {v2, v3, p1}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    invoke-static {}, Lcom/hyphenate/cloud/EMHttpClient;->getInstance()Lcom/hyphenate/cloud/EMHttpClient;

    move-result-object v3

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v2}, Lorg/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object v2

    sget-object v5, Lcom/hyphenate/cloud/EMHttpClient;->PUT:Ljava/lang/String;

    invoke-virtual {v3, v4, v0, v2, v5}, Lcom/hyphenate/cloud/EMHttpClient;->sendRequest(Ljava/lang/String;Ljava/util/Map;Ljava/lang/String;Ljava/lang/String;)Landroid/util/Pair;

    move-result-object v0

    iget-object v0, v0, Landroid/util/Pair;->second:Ljava/lang/Object;

    check-cast v0, Ljava/lang/String;

    const-string/jumbo v2, "error"

    invoke-virtual {v0, v2}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v2

    if-eqz v2, :cond_3

    const-string/jumbo v2, "EMClient"

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v4, "response error : "

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v2, v0}, Lcom/hyphenate/util/EMLog;->e(Ljava/lang/String;Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move v0, v1

    goto/16 :goto_0

    :catch_0
    move-exception v0

    const-string/jumbo v2, "EMClient"

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v4, "error:"

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v0}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v2, v0}, Lcom/hyphenate/util/EMLog;->e(Ljava/lang/String;Ljava/lang/String;)V

    move v0, v1

    goto/16 :goto_0

    :cond_3
    const/4 v0, 0x1

    goto/16 :goto_0
.end method

.method public uploadLog(Lcom/hyphenate/EMCallBack;)V
    .locals 1

    invoke-virtual {p0}, Lcom/hyphenate/chat/EMClient;->chatManager()Lcom/hyphenate/chat/EMChatManager;

    move-result-object v0

    iget-object v0, v0, Lcom/hyphenate/chat/EMChatManager;->emaObject:Lcom/hyphenate/chat/adapter/EMAChatManager;

    invoke-virtual {v0}, Lcom/hyphenate/chat/adapter/EMAChatManager;->uploadLog()V

    return-void
.end method
